<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="http://www.mianded.top/consumer/updateUser" method="post">
        <input type="hidden" name="_method" value="put" >
        <input type="file" name="image" value="上传图片" id="inputId">
        <input type="text" name="userId" value="40">  
        <input type="submit" value="提交表单" >
    </form>
    <button onclick="submitFun()">按钮</button>
    <script src="./jquery-3.4.1.min.js"></script>
    <script>
        
        function submitFun(){
                let inputId = document.querySelector('#inputId')
                let formData = new FormData();
                formData.append('image',inputId.files[0]);
                formData.append('userId',19);
                $.ajax({
                        url: 'http://www.mianded.top/consumer',
                        type:"PUT",
                        cache: false,
                        data:formData,
                        processData: false,
                        contentType: false,
                        success:function(data){
                            console.log(data);
                        }
                 })
        }
    </script>
</body>
</html>